import request from '@/utils/request'

export function createPersonel(query) {
	return request({
		url: "/api/delivery",
		method: "POST",
		data: query
	})
}

export function getPersonel(query) {
	return request({
		url: `/api/delivery/list`,
		method: "POST",
		data: query
	})
}

export function getWarehousePersonel(id) {
	return request({
		url: `/api/delivery/warehouseId/${id}`,
		method: "GET"
	})
}

export function searchPersonel(query) {
	return request({
		url: `/api/delivery/search`,
		method: "POST",
		data: query
	})
}

export function openPersonel(query) {
	return request({
		url: `/api/delivery/open`,
		method: "POST",
		data: query
	})
}

export function closePersonel(query) {
	return request({
		url: `/api/delivery/close`,
		method: "POST",
		data: query
	})
}

export function getPersonelInfo(id) {
	return request({
		url: `/api/delivery/${id}`,
		method: "GET"
	})
}

export function updatePersonelType(query) {
	return request({
		url: `/api/delivery/editType`,
		method: "PUT",
		data: query
	})
}

export function updatePersonel(query) {
	return request({
		url: `/api/delivery/edit`,
		method: "PUT",
		data: query
	})
}
